package string;

public class StringDemo {
    public static void main(String[] args) {
        String o1="123abc";
        String o2="123abc";
        String o3=new String("123abc");
        System.out.println(o1==o2);
        System.out.println(o1==o3);

        o1=o1+"!";
        System.out.println(o1==o2);
        String s1="123"+"abc";
        System.out.println(s1==o2);
        String s2="123";
        String s3=s2+"abc";
        System.out.println(s3==o2);

        String b1="abc";
        String b2=new String("abc");
        System.out.println(b1==b2);
        System.out.println(b1.equals(b2));
    }
}